    import { createRouter, createWebHashHistory } from 'vue-router';
    import type { RouteRecordRaw } from 'vue-router';
    import '@/views/Home.vue';
    import '@/views/About.vue';
    import '@/views/Content.vue';
    import '@/views/News.vue';
  
    
    const routes: RouteRecordRaw[] = [
      //重定向
      {
        path:'/',
        redirect:'/home'
      },
      {
        name:'zhuye',
        path: '/Home',
        component: () => import('@/views/Home.vue'),
      },
      {
        name:'guanyu',
        path: '/About',
        component: () => import('@/views/About.vue'),
      },
      {
        name:'neirong',
        path: '/Content',
        component: () => import('@/views/Content.vue'),
      },
      {
        name:'xinwen',
        path: '/News',
        component: () => import('@/views/News.vue'),
        children:[
          {
            name:'xiangqing',
            path: 'details',//query参数传递的方式
            // path: 'details/:id/:title/:content',//params参数传递的方式，:id/:title/:content代表占位
            component: () => import('@/views/Details.vue'),
           //对于params参数来说
            // props: true,
            //对于query参数来说
            props(route)
            {
                return route.query
            }
          },
        ],
        
      },
      
    ]
    
    const Router = createRouter(
        {
            history: createWebHashHistory(),
            routes,
        }
    )
    
    export default Router;